package com.ycsj.common.mvp;

import java.lang.ref.WeakReference;

/**
 * MVP层的P层基类
 * Created by Administrator on 2018/12/6 0006.
 */

public class BasePresenter<T> {

    //View层的弱引用
    protected WeakReference<T> mViewRef;

    /**
     * 将P层和V层绑定的方法
     *
     * @param view
     */
    public void attachView(T view) {
        mViewRef = new WeakReference<>(view);
    }


    /**
     * 将P层和V层解绑的方法
     */
    public void detachView() {
        mViewRef.clear();
    }

}
